<template>
  <div class="my-top-nav-box">
    <van-nav-bar :left-text="leftText" :left-arrow="isShowBack" @click-left="onClickLeft">
      <div slot="title">{{title}}</div>
      <div slot="right" @click="onClickRight">{{rightText}}</div>
    </van-nav-bar>
  </div>
</template>

<script>
export default {
  props: {
    // 标题
    title: {
      type: String,
      default: ""
    },
    // 左侧文案
    leftText: {
      type: String,
      default: "返回"
    },
    // 右侧内容
    rightText: {
      type: String,
      default: ""
    },
    // 是否显示返回图标
    isShowBack: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {};
  },
  methods: {
    /**
     * @author: 张志名 [1372342958@qq.com]
     * @description: 左侧返回
     * @return: {void}
     * @Date: 2019-12-13 09:08:47
     */
    onClickLeft() {
      this.$emit("clickBack");
    },
    /**
     * @author: 张志名 [1372342958@qq.com]
     * @description: 右侧按钮
     * @return: {void}
     * @Date: 2019-12-13 09:11:30
     */
    onClickRight() {
      this.$emit("clickRight");
    }
  }
};
</script>

<style lang="scss" scoped>
</style>